package com.zifan.sever.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zifan.sever.bean.Employee;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zifan
 * @since 2021-04-10
 */
public interface EmployeeMapper extends BaseMapper<Employee> {

    /**
     * 获取员工列表，并进行分页
     * @param employee 员工对象 为了查询
     * @param beginDateScope 日期范围，是个数组
     * @return
     */
    IPage<Employee> getEmployeesWithPage(Page<Employee> page, @Param("employee") Employee employee, @Param("beginDateScope") LocalDate[] beginDateScope);

    /**
     * 不分页获取所有员工列表
     * @param id 如果不传测查全部，传了则根据id查询
     * @return
     */
    List<Employee> getEmployees(Integer id);
}
